/*
 * @Date: 2023-05-29 11:50:24
 * @LastEditors: zhangxc 13083637819@163.com
 * @LastEditTime: 2023-10-18 09:49:51
 * @FilePath: \px-bi-front\src\const\crud\biinvestment.js
 */
export const tableOption = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  dialogDirection: "rtl",
  searchMenuSpan: 6,
  column: [
    {
      type: "input",
      label: "标题",
      prop: "name",
      search: true,
      rules: [
        {
          required: true,
          message: "请输入标题",
          trigger: "blur",
        },
      ],
    },
    {
      search: true,
      type: "select",
      label: "类型",
      prop: "type",
      dicUrl: `/dict/item/page?current=1&size=999&dictId=23`,
      props: {
        label: "label",
        value: "id",
      },
      dicFormatter: (data) => {
        return data.data.records;
      },
    },
    {
      type: "upload",
      label: "封面图片",
      prop: "img",
      span: 24,
      action: "/fastfile/upload/szgk-1256675456",
      listType: "picture-img",
      dataType: "string",
      propsHttp: {
        res: "data",
        url: "kpath",
      },
      limit: 1,
    },
    {
      label: "图片集",
      prop: "resources",
      type: "upload",
      action: "/fastfile/upload/szgk-1256675456",
      listType: "picture-card",
      dataType: "string",
      limit: 7,
      propsHttp: {
        res: "data",
        url: "kpath",
      },
      span: 24,
      rules: [
        {
          required: true,
          message: "请选择图片集",
          trigger: "change",
        },
      ],
    },
    {
      type: "map",
      label: "地址",
      prop: "address",
      dataType: "string",
      formatter: (data) => {
        if (data.address) {
          const str = data.address.split(",");
          return str[2];
        }
      },
      rules: [
        {
          required: true,
          message: "请选择地址",
          trigger: "change",
        },
      ],
    },
    {
      type: "input",
      label: "公司名称",
      prop: "companyName",
      rules: [
        {
          required: true,
          message: "请输入公司名称",
          trigger: "blur",
        },
      ],
    },
    {
      type: "input",
      label: "金额",
      prop: "money",
      rules: [
        {
          required: true,
          message: "请输入金额",
          trigger: "blur",
        },
      ],
    },
    {
      type: "input",
      label: "联系人",
      prop: "contact",
      rules: [
        {
          required: true,
          message: "请输入联系人",
          trigger: "blur",
        },
      ],
    },
    {
      type: "input",
      label: "联系电话",
      prop: "contactWay",
      rules: [
        {
          required: true,
          message: "请输入联系电话",
          trigger: "blur",
        },
      ],
    },
    {
      type: "input",
      label: "简介",
      prop: "introduction",
      maxlength: 100,
    },
    {
      type: "select",
      label: "标签",
      prop: "tag",
      multiple: true,
      span: 12,
      dicUrl: "/invesyment/biinvestment/tags",
      width: 150,
    },
    {
      type: "input",
      label: "内容",
      prop: "content",
      component: "avueUeditor",
      slot: true,
      hide: true,
      options: {
        action: "/fastfile/upload/szgk-1256675456",
        props: {
          res: "data", // 解析文件上传后的respose.JSON
          url: "kpath", // 解析responseJSON==> data.fileUrl
        },
      },
      span: 24,
    },

    {
      type: "input",
      label: "排序号",
      prop: "sort",
    },

    // {
    //   type: "input",
    //   label: "备注",
    //   prop: "remark",
    // },
  ],
};
